9d2858020d94b6f4051c18e4f01a38f6abaa5a4b,src/net/java/sip/communicator/impl/gui/main/call/CallDialog.java,CallDialog,ensureSize,#Component#number#number#,151
Before Change
if (xDelta > 0)
{
newFrameX -= xDelta;
if (newFrameX < screenBounds.x)
newFrameX = screenBounds.x;
}
if (yDelta > 0)
{
newFrameY -= yDelta;
if (newFrameY < screenBounds.y)
newFrameY = screenBounds.y;
}
// Don't get smaller than the min size.
Dimension minSize = frame.getMinimumSize();
if (newFrameWidth < minSize.width)
newFrameWidth = minSize.width;
if (newFrameHeight < minSize.height)
newFrameHeight = minSize.height;
/*
* If we're going to make too small a change, don't even bother.
* Besides, we don't want some weird recursive resizing.
*/
int frameWidthDelta = newFrameWidth - frameSize.width;
int frameHeightDelta = newFrameHeight - frameSize.height;
// Do not reduce the frame size.
if ((frameWidthDelta > 1) || (frameHeightDelta > 1))
{
if (!(frameWidthDelta > 1))
{
newFrameX = frameLocation.x;
newFrameWidth = frameSize.width;
}
else if (!(frameHeightDelta > 1))
{
newFrameY = frameLocation.y;
newFrameHeight = frameSize.height;
}
frame.setBounds(
newFrameX, newFrameY,
newFrameWidth, newFrameHeight);
}
}
}
After Change
* The latest requirement with respect to the behavior upon
* resizing is to center the Frame.
*/
int newFrameX
= screenBounds.x
+ (screenBounds.width - newFrameWidth) / 2;
int newFrameY
= screenBounds.y
+ (screenBounds.height - newFrameHeight) / 2;
// Do not let the top left go out of the screen.
if (newFrameX < screenBounds.x)
newFrameX = screenBounds.x;
if (newFrameY < screenBounds.y)
newFrameY = screenBounds.y;
frame.setBounds(
newFrameX, newFrameY,
newFrameWidth, newFrameHeight);
}
}
}